package org.javaboy.fmall.utils;


import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;
import java.util.Objects;

/**
 * @ClassName JsonSerializerUtils
 * @Description 格式化字符串注解
 * @Author find me
 * @Date 2020/8/18 0018 15:24
 * @Version 1.0
 */
public class JsonSerializerUtils extends JsonSerializer<Double> {
    @Override
    public void serialize(Double value, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
        if (Objects.nonNull(value)) {
            jsonGenerator.writeNumber(Double.valueOf(((Double)value).intValue()));
        }
    }


}